package com.example.exam.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author shishuqian
 * date 2021/4/26
 * time 22:02
 * 描述：用户填写的试卷，用户填写试卷答案表
 **/
@Data
@Entity
@Table(name = "t_exam_paper_answer")
@ApiModel(value = "用户提交的试卷作答")
public class ExamPaperAnswer implements Serializable {

    private static final long serialVersionUID = 2489433100313895442L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "试卷id",required = true,example = "154545")
    private Integer examPaperId;     //试卷id(填的是哪一份试卷)

    @ApiModelProperty(value = "试卷名称",required = true,example = "第一次考试")
    private String paperName;         //试卷名称

    @ApiModelProperty(value = "试卷填写人id",required = true,example = "124810")
    private Integer userId;       //试卷填写人id

    private String realName;  //试卷填写人姓名

//    @ApiModelProperty(value = "试卷总分",required = true,example = "1000")
      private Double paperScore;     //试卷总分

    private Double systemScore;      //系统判定的得分

    private Double teacherScore;     //老师评分

    private Double finalScore;       //填写人最终得分

    private Integer questionCount;    //题目总数量

    private Integer systemCorrect;  //系统判定做对题目数量

    private Integer teacherCorrect;  //老师判定做对题目数量

    @ApiModelProperty(value = "试卷提交时间",required = true,example = "2021-05-08")
    private Date createTime;          //试卷提交时间

    @ApiModelProperty(value = "做题时间",required = true,example = "6000")
    private Integer doTime;           //做题时间(秒)

    private Integer status;               //试卷批改状态1.系统完成评分2.完成打分

    private Boolean finishStatus;         //做卷状态 true已完成提交，结束考试，不能再提交

    @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinColumn(name = "exam_paper_answer_id")
    private List<QuestionAnswer> questionAnswerList;  //用户提交的题目答案



}
